package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Dxvaoikc type
*/
@SuppressWarnings("ALL")
public class Dxvaoikc {


        private static volatile Dxvaoikc instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Dxvaoikc getInstance() {
            if (instance == null) {
                synchronized (Dxvaoikc.class) {
                    if (instance == null) {
                        instance = new Dxvaoikc();
                    }
                }
            }
            return instance;
        }


        private Dxvaoikc() {

        }



    public  Boolean judgeKamrwnwgrs(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeEmjgbpdrbp(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeNqbemqlhcb(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeMbbzdciijc(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeLbgmsomblw(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgePurhfsqbcu(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeLgymjomrdy(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeCaoekyjgmh(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeGsxfslgjuc(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeTwwmdzoyvo(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  kamrwnwgrs;
    private String  emjgbpdrbp;
    private String  nqbemqlhcb;
    private String  mbbzdciijc;
    private String  lbgmsomblw;
    private String  purhfsqbcu;
    private String  lgymjomrdy;
    private String  caoekyjgmh;
    private String  gsxfslgjuc;
    private String  twwmdzoyvo;


    public void setKamrwnwgrs(String kamrwnwgrs){
    this.kamrwnwgrs = kamrwnwgrs;
    }

    public String getKamrwnwgrs(){
    return this.kamrwnwgrs;
    }
    public void setEmjgbpdrbp(String emjgbpdrbp){
    this.emjgbpdrbp = emjgbpdrbp;
    }

    public String getEmjgbpdrbp(){
    return this.emjgbpdrbp;
    }
    public void setNqbemqlhcb(String nqbemqlhcb){
    this.nqbemqlhcb = nqbemqlhcb;
    }

    public String getNqbemqlhcb(){
    return this.nqbemqlhcb;
    }
    public void setMbbzdciijc(String mbbzdciijc){
    this.mbbzdciijc = mbbzdciijc;
    }

    public String getMbbzdciijc(){
    return this.mbbzdciijc;
    }
    public void setLbgmsomblw(String lbgmsomblw){
    this.lbgmsomblw = lbgmsomblw;
    }

    public String getLbgmsomblw(){
    return this.lbgmsomblw;
    }
    public void setPurhfsqbcu(String purhfsqbcu){
    this.purhfsqbcu = purhfsqbcu;
    }

    public String getPurhfsqbcu(){
    return this.purhfsqbcu;
    }
    public void setLgymjomrdy(String lgymjomrdy){
    this.lgymjomrdy = lgymjomrdy;
    }

    public String getLgymjomrdy(){
    return this.lgymjomrdy;
    }
    public void setCaoekyjgmh(String caoekyjgmh){
    this.caoekyjgmh = caoekyjgmh;
    }

    public String getCaoekyjgmh(){
    return this.caoekyjgmh;
    }
    public void setGsxfslgjuc(String gsxfslgjuc){
    this.gsxfslgjuc = gsxfslgjuc;
    }

    public String getGsxfslgjuc(){
    return this.gsxfslgjuc;
    }
    public void setTwwmdzoyvo(String twwmdzoyvo){
    this.twwmdzoyvo = twwmdzoyvo;
    }

    public String getTwwmdzoyvo(){
    return this.twwmdzoyvo;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}